//--------------颜色选择器-----------------
dhtmlxColorPickerLangModules = {}; 

dhtmlxColorPickerLangModules['my-lang'] = {
    langname: 'my-lang',
    labelHue : "色调",
    labelSat : "饱和度", 
    labelLum : "亮度",
    labelRed : "红", 
    labelGreen : "绿",
    labelBlue : "蓝",
    btnAddColor : "添加自定义颜色",
    btnSelect : "选择",
    btnCancel : "取消"
};

dhtmlXCalendarObject.prototype.langData = {
    "en": {
        dateformat: "%Y-%m-%d",
        monthesFNames: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
        monthesSNames: ['一','二','三','四','五','六','七','八','九','十','十一','十二'],
        daysFNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
        daysSNames: ['日','一','二','三','四','五','六'],
        weekstart: 1
    }
};

jQuery(function($){
	//-----------------jquery ui----------------
	if($.datepicker){
		$.datepicker.regional['zh-CN'] = {
				closeText: '关闭',
				prevText: '&#x3c;上月',
				nextText: '下月&#x3e;',
				currentText: '今天',
				monthNames: ['一月','二月','三月','四月','五月','六月',
				'七月','八月','九月','十月','十一月','十二月'],
				monthNamesShort: ['一','二','三','四','五','六',
				'七','八','九','十','十一','十二'],
				dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
				dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
				dayNamesMin: ['日','一','二','三','四','五','六'],
				weekHeader: '周',
				dateFormat: 'yy-mm-dd',
				firstDay: 1,
				isRTL: false,
				showMonthAfterYear: true,
				yearSuffix: '年'};
		$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
	}
	
	//--------------scheduler------------------
	if(window.scheduler){
		scheduler.config.day_date="%M %d日 %D";
		scheduler.config.default_date="%Y年 %M %d日";
		scheduler.config.month_date="%Y年 %M";

		scheduler.locale={
			date: {
				month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
				month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
				day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
				day_short: ["日", "一", "二", "三", "四", "五", "六"]
			},
			labels: {
				dhx_cal_today_button: "今天",
				day_tab: "日",
				week_tab: "周",
				month_tab: "月",
				new_event: "新建会议预约",
				icon_save: "保存",
				icon_cancel: "关闭",
				icon_details: "详细",
				icon_edit: "编辑",
				icon_delete: "删除",
				//confirm_closing: "请确认是否撤销修改!",
				//confirm_deleting: "是否删除会议预约?",
				section_description: "描述",
				section_time: "时间范围",
				full_day: "整天",

				confirm_recurring:"----",
				section_recurring:"重复周期",
				button_recurring:"启用",
				button_recurring_open:"禁用",
				button_edit_series: "----",
		        button_edit_occurrence: "----",
				
				/*agenda view extension*/
				agenda_tab:"列表",
				date:"日期",
				description:"说明",
				
				/*year view extension*/
				year_tab:"今年"
			}
		};
		scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />按天</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>按周</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />按月</label><br /> <label  style="display:none;"><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />按年</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>每</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />天<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>每个工作日</label> </div> <div style="display:none;" id="dhx_repeat_week"> 重复 每<input class="dhx_repeat_text" type="text" name="week_count" value="1" />星期的:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />星期一</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />星期四</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />星期二</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />星期五</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />星期三</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />星期六</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />星期日</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>重复</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />日 每<input class="dhx_repeat_text" type="text" name="month_count" value="1" />月<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>第</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >星期一<option value="2">星期二<option value="3">星期三<option value="4">星期四<option value="5">星期五<option value="6">星期六<option value="0">星期日</select>每<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />月<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>每</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />日<select name="year_month"><option value="0" selected >一月<option value="1">二月<option value="2">三月<option value="3">四月<option value="4">五月<option value="5">六月<option value="6">七月<option value="7">八月<option value="8">九月<option value="9">十月<option value="10">十一月<option value="11">十二月</select>月<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>在</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >星期一<option value="2">星期二<option value="3">星期三<option value="4">星期四<option value="5">星期五<option value="6">星期六<option value="7">星期日</select>的<select name="year_month2"><option value="0" selected >一月<option value="1">二月<option value="2">三月<option value="3">四月<option value="4">五月<option value="5">六月<option value="6">七月<option value="7">八月<option value="8">九月<option value="9">十月<option value="10">十一月<option value="11">十二月</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>无结束日期</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />重复</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />次结束<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />结束于</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
	}

	//-----------easyui------------
	if ($.messager){
		$.messager.defaults.ok = '确定';
		$.messager.defaults.cancel = '取消';
	}
	if ($.fn.validatebox){
		$.fn.validatebox.defaults.missingMessage = '该输入项为必输项';
		$.fn.validatebox.defaults.rules.email.message = '请输入有效的电子邮件地址';
		$.fn.validatebox.defaults.rules.url.message = '请输入有效的URL地址';
		$.fn.validatebox.defaults.rules.length.message = '输入内容长度必须介于{0}和{1}之间';
		$.fn.validatebox.defaults.rules.positiveInt.message='请输入正整数.';
		$.fn.validatebox.defaults.rules.digit.message='请输入数字.';
		$.fn.validatebox.defaults.rules.nodelimiter.message='不能包含逗号.';
		$.fn.validatebox.defaults.rules.ip.message='请输入有效的IP地址.';
		$.fn.validatebox.defaults.rules.between.message = '请输入 {0} 到  {1} 之间的值.';
	}
});

var messages={};

messages.getMsg=function(key,params){
	if(params){
		var msg=this.getMsg(key);
		
		for ( var i = 0; i < params.length; i++) {
			msg=msg.replace("{"+i+"}",params[i]);
		}
		return msg;
	}else{
		return eval("messages['"+key+"']")||key;
	}
};
messages["confirm.useProfile"]="是否确定套用该会议模板?";
messages["confirm.tip"]="是否确定执行该项操作?";
messages["confirm.hangup"]="Are you sure hang up these calls?";
messages["confirm.mute"]="Are you sure mute these calls?";
messages["confirm.cancelMute"]="Are you sure cancel these calls mute?";
messages["confirm.setLecture"]="Are you sure specify the caller as lecture?";
messages["confirm.cancelLecture"]="Are you sure cancel the conference lecture?";
messages["confirm.endConf"]="是否确定删除会议?";
messages["confirm.pauseConf"]="是否确定停止会议?";
messages["noSelect.tip"]="Please select record.";
messages["oneSelect.tip"]="Please select single record only.";
messages["group.confirm.tip"]="所有群组成员将被删除，是否确认删除?";

messages["mcu.error.nameExist"]="{0} 已存在";
messages["mcu.tip.local"]="不能删除本机MCU";

messages["error.exist"]="{0} 已存在.";
messages["admin.tip.root.remove"]="不能删除超级管理员账号";
messages["admin.error.nameExist"]="{0} 已存在.";
messages["admin.tip.root.modify"]="不能修改超级管理员账号.";

messages["account.error.nameExist"]="{0} 已存在.";

messages["participant.drap.tip"]="个与会者";

messages["img.tip.mute"]="MCU打开静音";
messages["img.tip.speak"]="MCU关闭静音";
messages["img.tip.incall"]="通话中";
messages["img.tip.registed"]="已注册";
messages["img.tip.online"]="网络可达";
messages["img.tip.lecture"]="演讲人";
messages["img.tip.record"]="录像机";
messages["img.tip.h239owner"]="双流发起者";
messages["img.tip.chairperson"]="主席";
messages["img.tip.micomute"]="终端打开静音";
messages["img.tip.micspeak"]="终端关闭静音";
messages["img.tip.disable"]="禁止";
messages["img.tip.callout"]="呼出";
messages["img.tip.callin"]="呼入";
messages["img.tip.network.offline"]="终端离线";
messages["img.tip.network.good"]="线路条件好，基本无丢包";
messages["img.tip.network.medium"]="线路条件一般，有一定丢包";
messages["img.tip.network.bad"]="线路条件差，丢包较多";
messages["conf.ctrl.rx"]="接收";
messages["conf.ctrl.tx"]="发送";
